package com.sfzlot.dev.netty.bean.data;

import com.sfzlot.dev.netty.bean.inf.Data;
import com.sfzlot.dev.netty.utils.ByteUtil;

/**
 * 设备更改初始值请求体
 * Created by pierr on 2017/5/30.
 */
public class DeviceSettingInData implements Data {
    
    private String ssid;			// wifi名称
    private String password;		// wifi密码

	public String getSsid() {
		return ssid;
	}

	public void setSsid(String ssid) {
		this.ssid = ssid;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}


	@Override
	public String toString() {
		return "DeviceSettingInData [ssid=" + ssid + ", password=" + password + "]";
	}

	@Override
	public byte[] toBytes(){
		byte[] ssidBytes = ByteUtil.stringToByte(ssid, 32);
		byte[] passwordBytes = ByteUtil.stringToByte(password, 32);
		return ByteUtil.addAll(ssidBytes, passwordBytes);
	}

	@Override
	public String transData() {
		return "DeviceSettingInData(设备更改初始值请求体) [ssid=" + ssid + ", password=" + password + "]";
	}
}
